const basicConfigRules = {
  dsName: [
    {
      message: '不能包含除英文、数字及"_"外的其它字符',
      pattern: /^[a-zA-Z0-9_]{0,}$/,
    },
  ],
  intlPrefix: [
    {
      message: '不能包含除英文、数字及"."外的其它字符',
      pattern: /^[a-zA-Z0-9.]{0,}$/,
    },
  ],
  url: [
    {
      message: '不能包含除英文、数字及"/"外的其它字符',
      pattern: /^[a-zA-Z0-9/]{0,}$/,
    },
  ],
}

const otherConfigRules = {
  field: [
    {
      message: '不能包含除英文、数字外的其它字符',
      pattern: /^[a-zA-Z0-9]{0,}$/,
    },
  ],
}

const fieldConfigRules = {
  name: [
    {
      message: '不能包含除英文、数字及"_"外的其它字符',
      pattern: /^[a-zA-Z0-9_]{0,}$/,
    },
  ],
  lookupCode: [
    {
      message: '不能包含除大写英文、数字及"_"外的其它字符',
      pattern: /^[A-Z0-9_]{0,}$/,
    },
  ],
}

export {
  basicConfigRules,
  otherConfigRules,
  fieldConfigRules,
}